<?php
class Widget extends CWidget {

    /**
     * @var string images path of this widget
     */
    public $imagesPath;

    /**
     * @var string css path of this widget
     */
    public $cssPath;

    /**
     * @var string javascript path of this widget
     */
    public $jsPath;

    /**
     * @var boolean current user is guest or authendicated
     */
    public $isGuest = true;

    /**
     * Initializes the widgets
     */
    public function init() {
        parent::init();

        if ($this->imagesPath === null)
            $this->imagesPath = $this->controller->imagesPath;
        if ($this->cssPath === null)
            $this->cssPath = $this->controller->cssPath;
        if ($this->jsPath === null)
            $this->jsPath = $this->controller->jsPath;
        $this->isGuest = Yii::app()->user->isGuest;
    }

    public function url($route, $params = array()) {
        return Yii::app()->createUrl($route, $params);
    }

}//end class